const dns = require('dns');
let domain = 'baidu.com';
dns.resolve(domain, function(err, address) {
    if (err) {
        console.log(err);
        return;
    }
    console.log(address);
});

/**
 * 域名解析为Ip数组
 * [ '110.242.68.66', '39.156.66.10' ]
 */